#include "UdpServer.hpp"
#include <memory>
#include "Dict.hpp"

void Usage(string proc)
{
    cout << "Usage: " << proc << "+port" << endl;
}
int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t serverport = stoi(argv[1]);
    Dict dict;

    func_t trans = bind(&Dict::Translate, &dict, placeholders::_1);
    unique_ptr<UdpServer> upds = make_unique<UdpServer>(serverport, trans);
    upds->InitServer();
    upds->Start();

    return 0;
}